package com.knowledge.plus.设计模式.建造者模式.impl;

import com.knowledge.plus.设计模式.建造者模式.Builder;
import com.knowledge.plus.设计模式.建造者模式.Building;

/**
 * 别墅施工队
 *
 * @author TPF
 * @since 2023/12/12
 */
public class HouseBuilder implements Builder {
    private Building house;

    public HouseBuilder() {
        house = new Building();
    }

    /**
     * 施工三步曲
     */
    @Override
    public void buildBasement() {
        System.out.println("建造地基");
        house.setBasement("╬╬╬╬╬╬╬╬╬╬\n");
    }

    @Override
    public void buildWall() {
        System.out.println("建造墙体");
        house.setWall("｜田｜田 田|\n");
    }

    @Override
    public void buildRoof() {
        System.out.println("建造屋顶");
        house.setRoof("╱◥███████◣\n");
    }

    @Override
    public Building getBuilding() {
        return house;
    }
}